<#list tables as tableInfo>

-- 「${tableInfo.comment}」表
DROP TABLE IF EXISTS ${tableInfo.tableName};
CREATE TABLE IF NOT EXISTS ${tableInfo.tableName}(
<#list tableInfo.fields as field>
`${field.name}` ${field.type}<#if field.length??>(${field.length})</#if><#if field.isPrimaryKey> AUTO_INCREMENT PRIMARY KEY </#if> COMMENT '${field.comment}'<#if field_has_next>,</#if>
</#list>
) ENGINE InnoDB CHARACTER SET ${tableInfo.charset} COMMENT '${tableInfo.comment}';
<#if tableInfo.indexNames??>
<#list tableInfo.indexNames as indexName>
CREATE INDEX ${tableInfo.tableName}_${indexName} ON ${tableInfo.tableName} (${indexName});
</#list>
</#if>
</#list>